window.onload = function() {
    let div_child = document.getElementById("div_child")
    let div_parent = document.getElementById("div_parent")

    div_child.addEventListener("click", (event) => {
        event.stopPropagation() //阻止冒泡
        console.log("无敌爆爆龙被点了")
    })
    div_parent.addEventListener("click", () => {
        console.log("宇宙无敌暴龙战士被点了")
    })

    document.querySelectorAll("ul")[0].addEventListener("click", (event) => {
        console.log(event.target.innerText)
        console.log(event.currentTarget.innerText)
    })
    document.getElementsByTagName("a")[0].addEventListener("click", (event) => {
        // event.preventDefault() //阻止a跳转
        console.log("a元素被点击")
    })
    console.log(document.documentElement)
    console.log(document.body)
    window.alert("即将打开页面")
}